/*
 * ElementsVisitor.hpp
 *
 *  Created on: 06-01-2011
 *      Author: Przemek
 */

#pragma once

#include "world/Barrier.hpp"
#include "world/Individual.hpp"
#include "world/MeatSupply.hpp"
#include "world/VegetableSupply.hpp"
#include "world/WaterSupply.hpp"
#include "world/World.hpp"

/*
 * A visitor pattern base class.
 */
class ElementsVisitor
{
	public:
		virtual void visit(Barrier& barrier) = 0;
		virtual void visit(Individual& individual) = 0;
		virtual void visit(MeatSupply& meatSupply) = 0;
		virtual void visit(VegetableSupply& vegetableSupply) = 0;
		virtual void visit(WaterSupply& waterSupply) = 0;

		// these functions call visit on every element of the vector given
		void visitEveryElement(World::ElementsVector& elements);
		void visitEveryElement(const World::ElementsVector& elements);
		void visitEveryElement(std::vector<Element*>& elements);
		void visitEveryElement(const std::vector<Element*>& elements);
};

